// common/component/XcxVisits.js
let app = getApp();

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    parent: Object
  },
  /**
   * 组件的初始数据
   */
  data: {
    visits: {
      session_cnt: 0,
      visit_pv: 0,
      visit_uv: 0,
      visit_uv_new: 0
    },
    num_color: ''
  },
  /**
   * 组件的方法列表
   */
  methods: {
    getVisits() {
      app.util.request({
        url: 'auth/session/visit_summary',
        data: {},
        success: res => {
          this.setData({ visits: res.data.data });
        },
      });
    }
  },
  ready() {
    this.setData({ num_color: 'color:' + this.properties.parent.config.default.price.color.value + ';' });
    this.getVisits();
  }
});